package org.itstack.demo.design;

import org.itstack.demo.design.util.RedisUtil;

/**
 * @Author: fanYuLe
 * @CreateTime: 2023-12-25  15:57
 * @Description:
 */
public class ActivityController {
    private RedisUtil redisUtil = new RedisUtil();

    public Activity queryActivityInfo(Long id){
        Activity activity = ActivityFactory.getActivity(id);
        //模拟从Redis中获取库存变化信息
        Stock stock = new Stock(1000, redisUtil.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
}
